<?

		$vid 					= intval($_REQUEST['vid']);
		$del 					= intval($_REQUEST['del']);
		$real_delete 	= intval($_REQUEST['real_delete']);

		if ($vid AND checkPrivAdmin()) {

			$vacancy_old = getOneRow($TABLE_PREFIX, "vid=$vid");

			if (is_array($vacancy_old)) {

				if (!$del AND !$real_delete) {

					if ($vacancy_old['status'] == 128) $data['status'] = 0;
					else 															 $data['status'] = 128;

					updateTable($TABLE_PREFIX, "vid=$vid", $data);

					$vacancy_old = getOneRow($TABLE_PREFIX, "vid=$vid");
					$vacancy_category = getOneRow($TABLE_PREFIX."_category", "cid=$vacancy_old[cid]");

					Header("Location: /".$TABLE_PREFIX."/".$vacancy_category[link]."/");
					exit();

				} else if ($real_delete) {

					deleteFrom($TABLE_PREFIX, "vid=$vid");
					$vacancy_category = getOneRow($TABLE_PREFIX."_category", "cid=$vacancy_old[cid]");

					Header("Location: /".$TABLE_PREFIX."/".$vacancy_category[link]."/");
					exit();

				}		

			} else {

				Header("Location: /".$TABLE_PREFIX."/");
				exit();
			}

		}

?>